<template>
	<view>
		<view class="mainpadding2">
			<view class="mainpadding radius ffffff margin_top" v-for="(item,index) in list.data" :key="item.id">
				<view class="flexbetween">
					<view class="flexleft">
						<image class="touxiag margin_right2" :src="item.user.avatar_text" mode=""></image>
						<view class="">
							<view class="zhonghei sanshier ">{{item.user.nickname}}</view>
							<view class="xiaohui ershil margin_top1 ">{{item.createtime_text}}</view>
						</view>
					</view>
					<u-rate :value="item.star" activeColor="#ff9341" readonly></u-rate>
				</view>
				<view class="xiaohui ershiba margin_top">{{item.content}}</view>
				<view class="flexleft flex_wrap pdl">
					<view class="flexcenter tpbox " v-for="(ite,ind) in item.images_text" :key="ind">
						<view class="tjtp">
							<image class="" :src="ite" mode="" @click="lbtpriview(ind,item.images_text)"></image>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				page: 1,
				limit: 12,
				list: {
					data: []
				},
				listid:""
			}
		},
		onLoad(options) {
			this.listid = options.id
			this.init()
		},
		methods: {
			init(isPage, page) {
				let _this = this
				let data = {
					page: page || 1,
					limit: _this.limit,
					goods_id:this.listid
				}
				let url="/api/goodscl/goodsComment"
				httpRequest.request(url, 'GET', data, false, false, true).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							_this.list.data = resList.data;
						}
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
			
		}
	}
</script>
<style lang="scss" scoped>
	page{
		background-color: #f8f8f8;
	}
	.scyyzz {
		width: 100%;
		height: 291rpx;
	}
	.touxiag {
		width: 73rpx;
		height: 73rpx;
		border-radius: 50%;
	}
	.tpbox {
		width: 33.33%;
		margin-top: 30rpx;
	}
	
	.tjtp {
		width: 209rpx;
		height: 209rpx;
		position: relative;
	
		image {
			border-radius: 10rpx;
			width: 100%;
			height: 100%;
		}
	}
	.qubtn{
		width: 265rpx;
		height: 81rpx;
		background-color: #FF9341;
		border: 1rpx solid #FF9341;
		font-size: 30rpx;
		font-family: PingFang SC, PingFang SC;
		border-radius: 51rpx;
		font-weight: 500;
		color: #FFFFFF;
	}
	.qxdtn{
		width: 265rpx;
		height: 81rpx;
		border: 1rpx solid #FF9341;
		font-size: 30rpx;
		font-family: PingFang SC, PingFang SC;
		border-radius: 51rpx;
		font-weight: 500;
		color: #FF9341;
	}
	.textarea {
		height: 372rpx;
		border-radius: 10rpx 10rpx 10rpx 10rpx;
		box-sizing: border-box;
		width: 100%;
		padding: 30rpx;
		border: 1rpx solid #DFDFDF;
	}
	.scbtn {
		width: 94rpx;
		font-size: 20rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		color: #FF9341;
		border: 1rpx solid #FF9341;
		height: 46rpx;
		border-radius: 84rpx;
	}

	.zuixbtn {
		border-radius: 84rpx;
		width: 94rpx;
		font-size: 20rpx;
		font-family: PingFang SC, PingFang SC;
		font-weight: 500;
		color: #666666;
		border: 1rpx solid #666666;
		height: 46rpx;
	}

	.mdtp {
		width: 74rpx;
		height: 74rpx;
		border-radius: 14rpx 14rpx 14rpx 14rpx;
	}

	.huibox {
		padding: 10rpx;
		background: #F8F8F8;
		border-radius: 14rpx 14rpx 14rpx 14rpx;
	}

	.tupian {
		width: 140rpx;
		height: 140rpx;
		border-radius: 18rpx 18rpx 18rpx 18rpx;
	}

	.touxiang {
		width: 73rpx;
		height: 73rpx;
		border-radius: 50%;
	}

	.tab_nav {
		background-color: #fff;
		display: flex;
		justify-content: center;
		align-items: center;
		padding-bottom: 11rpx;
	}

	.tab_nav .navTitle {
		height: 76rpx;
		line-height: 76rpx;
		width: 100%;
		text-align: center;
		font-size: 30rpx;
		font-weight: bold;
		color: #999999;
	}

	.active {
		font-size: 30rpx;
		color: #333333;
		font-weight: bold;
		position: relative;
	}

	.active::after {
		content: "";
		position: absolute;
		width: 61rpx;
		height: 6rpx;
		background: #FFB800;
		border-radius: 9rpx;
		background-size: 100% 100%;
		left: 0rpx;
		right: 0rpx;
		bottom: 0rpx;
		margin: auto;
	}
</style>